<%@ Page Language="VB" AutoEventWireup="false" CodeFile="SQCompareL.aspx.vb" Inherits="SAD_SQCompareL" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>Database Comparsion</title>
    
    <link href="ADStyles.css" rel="stylesheet" type="text/css" />
        
    <script type="text/javascript">
    /* <![CDATA[ */
        function NewWindowForPrinting()
        {
            var oFrame = document.getElementById('Comparison');
            
            var WinRef = window.open(oFrame.src,'Database_Compare','width=515,height=600'
                                   +',menubar=1'
                                   +',toolbar=1'
                                   +',status=0'
                                   +',scrollbars=1'
                                   +',resizable=1');
        }

        function setDBCombo(varName,varValue)
        {
            var DBComboName='cmb' + varName + 'Database';
            var DBCombo=document.getElementById(DBComboName);
            DBCombo.value=varValue;        
        }
 
        function setREVCombo(varName,varValue)
        {
            var REVComboName='cmb' + varName + 'Revision';
            var REVCombo=document.getElementById(REVComboName);
            REVCombo.value=varValue;        
        }
               
        function onServerChange(varName)
        {
            setDBCombo(varName,'');
            setREVCombo(varName,'');
            
            document.form1.submit();
        }
        
        function onDatabaseChange(varName)
        {
            setREVCombo(varName,'');
            
            document.form1.submit();
        }
        
        function onRevisionChange(varRev)
        {
            document.form1.submit();
        }
        
        function onLoad()
        {
            var oFrame = document.getElementById('Comparison');
            var sSrc=oFrame.src;
            var iLen=sSrc.length;
            
            if (iLen>4)
            {
                if ((String(sSrc).substring(iLen-3,iLen)=='xml')
                    || (String(sSrc).substring(iLen-3,iLen)=='XML'))
            
                { 
                    var oButton=document.getElementById('cmdView');
                    oButton.style.visibility='visible';       
                }
            }
        }
    /* ]]> */
    </script>
</head>
<body onload="onLoad();">
    <form id="form1" runat="server">
    <div>
        <table style="width:310px;">
            <tr>
                <td>
                &nbsp;
                </td>
                <td>
                Source
                </td>
                <td>
                Target
                </td>
            </tr>
            
            <tr>
                <td>
                Server:
                </td>
                
                <td>
                <select id="cmbSourceServer" onchange="onServerChange('Source');" runat="server"/>
                </td>
                
                <td>
                <select id="cmbTargetServer" onchange="onServerChange('Target');" runat="server"/>
                </td>
            </tr>
            
            <tr>
                <td>
                Database:
                </td>
                
                <td>
                <select id="cmbSourceDatabase" onchange="onDatabaseChange('Source');" runat="server"/>
                </td>
                
                <td>
                <select id="cmbTargetDatabase" onchange="onDatabaseChange('Target');" runat="server"/>
                </td>
            </tr>
            
            <tr>
                <td>
                Revision:
                </td>
                
                <td>
                <select id="cmbSourceRevision" onchange="onRevisionChange('Source');" runat="server"/>
                </td>
                
                <td>
                <select id="cmbTargetRevision" onchange="onRevisionChange('Target');" runat="server"/>
                </td>
            </tr>
            
            
            <tr>
                <td colspan="3" style="vertical-align:bottom;">
                <input type="submit" id="cmdExecute" value="Compare Databases" runat="server" style="margin-bottom:10px;" />
                
                <input type="image"
                   id="cmdView"
                   src="images/tb_newwindow.jpg"
                   onclick="javascript:NewWindowForPrinting();"  
                   title="View in seperate window for printing"
                   alt="View in seperate window for printing"
                   visible="false"
                   style="visibility:hidden; padding-left: 20px;" />
                </td>
            </tr>
        </table>
        
        <iframe id="Comparison" src="<%=XMLPath %>" style="width:500px; height: 350px; border: none;"></iframe>

    </div>
    </form>
</body>
</html>
